UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Anj/j0FFA8j0+/BK0PpxFKvWyx21sSHsGKmZJTAJl5w=' 
WHERE 
  key_id = '8b96075a6da979217fa1446868acd0cf75c78b0aa15b9572a6d9c70961abf384' 
  AND (
    token = 'Anj/j0FFA8j0+/BK0PpxFKvWyx21sSHsGKmZJTAJl5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021