UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sYy6s8vGo/sHWscaO/b3edL76rk/LoF9+Mv+eKcVZCc=' 
WHERE 
  key_id = '9abd207bd9c3fd629615e992d9c8e70e93e514bfafe6509e86da402dc7550c54' 
  AND (
    token = 'sYy6s8vGo/sHWscaO/b3edL76rk/LoF9+Mv+eKcVZCc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042