UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'flaDtfhPgxCX/YMjjM83XYpqJ0RodJ8KqRlNlOnDKPs=' 
WHERE 
  key_id = '928aa7a9624c8513ef076850909a21c7b4ff2dc2b448f963e24e85bc627e3ffd' 
  AND (
    token = 'flaDtfhPgxCX/YMjjM83XYpqJ0RodJ8KqRlNlOnDKPs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023