UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eSdeKxXnJVwNFDM+6KGymFV3JDhBfgyxGLfUNNWNBjQ=' 
WHERE 
  key_id = 'd44b6fe630e807187c03e12d07c0eeec1540ae3abaa7fdb6f57ea619623dc067' 
  AND (
    token = 'eSdeKxXnJVwNFDM+6KGymFV3JDhBfgyxGLfUNNWNBjQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032