UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0u/cP2oCn13wKIEv4MdLWKf4xv9/OtyExYJwvbEgFu4=' 
WHERE 
  key_id = '9c343537276c607ae8420c6ec905415fb1ecb6db1de40f985df12a62dcf90deb' 
  AND (
    token = '0u/cP2oCn13wKIEv4MdLWKf4xv9/OtyExYJwvbEgFu4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028