UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zMe1YzATGnofDgykWwvLrcPadGFTjjyNDc3v9IieHY4=' 
WHERE 
  key_id = 'a01408a88183d7bbaa5c1abda660ca345e6c912cae392b9363a25c019498d8c6' 
  AND (
    token = 'zMe1YzATGnofDgykWwvLrcPadGFTjjyNDc3v9IieHY4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021