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

Query time 0.00023