UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y2N1tqdQPv3RMyFrl0kCOMshUy5MBxpQBzy3mYLXZfY=' 
WHERE 
  key_id = 'f93f573ab57ca05e7fde295112205b06347204da232acb302aa70b904c6bdd7d' 
  AND (
    token = 'y2N1tqdQPv3RMyFrl0kCOMshUy5MBxpQBzy3mYLXZfY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048