UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eOKWEibv/A+ffMCXs//AQSqcOo6DFdIQkM2kf6cFVkQ=' 
WHERE 
  key_id = '97c3c269e2111c0979601f625b21d4d41c92875ad8a7202ba6062ca14c92fea9' 
  AND (
    token = 'eOKWEibv/A+ffMCXs//AQSqcOo6DFdIQkM2kf6cFVkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034