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

Query time 0.00046