UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mqQEDS3gL06e3OCEThJSpntZJzyRN2M9w9KbygqsLQ8=' 
WHERE 
  key_id = '002c1dfd4a886ab01532b2b51f8858782fec17a932a57c4c44d203183e2e3591' 
  AND (
    token = 'mqQEDS3gL06e3OCEThJSpntZJzyRN2M9w9KbygqsLQ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032