UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VFvSzHE3u9xbNNjY8q/5z1MyzGolK25wiBt0azVEKso=' 
WHERE 
  key_id = 'd5472f466322a11f22b3803fe881f68d225b887c9db17f438a00b8256b7b9013' 
  AND (
    token = 'VFvSzHE3u9xbNNjY8q/5z1MyzGolK25wiBt0azVEKso=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030