UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2vEf0PbV0bB+V+VfXcfOinXJbJB83fEtNhmGj5ijexc=' 
WHERE 
  key_id = 'e98c88295b82e16cb514c25d8c854d9405f7e7032c8d10f67d55251b2f018ad1' 
  AND (
    token = '2vEf0PbV0bB+V+VfXcfOinXJbJB83fEtNhmGj5ijexc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040