UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U/lR/Mfan72GQTQZJCfUddg+s92582RKZOOKvUGzAMI=' 
WHERE 
  key_id = '606784473837fd94d5d309dac455e518db523eb7aaa070588fa577e109db4828' 
  AND (
    token = 'U/lR/Mfan72GQTQZJCfUddg+s92582RKZOOKvUGzAMI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023