UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uvGr9GO9i2LfkjFuKR0ayB1TQ6si6bj1wbHN6PTPOaQ=' 
WHERE 
  key_id = '4c8e0ae1b17354eeac3e9477f5c3158b5a17b29b7bdc8c3279884ef90d00cd2d' 
  AND (
    token = 'uvGr9GO9i2LfkjFuKR0ayB1TQ6si6bj1wbHN6PTPOaQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034