UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gO+NfGCf9oSg3XXF4m1IPEIh9vp2wRWMDB34mftNKao=' 
WHERE 
  key_id = '2fd01b501d8f95fa34d29a28888286f6a4e95e5ca56ba64e8465d63e457fe077' 
  AND (
    token = 'gO+NfGCf9oSg3XXF4m1IPEIh9vp2wRWMDB34mftNKao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030