UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ajiwEbzwCou4t1pUCfBOFHO+mB4tJhfjB3mJqY+1+Q=' 
WHERE 
  key_id = '8ad32c66d62e3d0a8ba6c388a5f6ecdef71bb5384f1c0f250da10fbeb513fdbc' 
  AND (
    token = '/ajiwEbzwCou4t1pUCfBOFHO+mB4tJhfjB3mJqY+1+Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029