UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8DpF8/F6uy2tMCF7ILg4IriHdFoCeDKyGJLiA66q4tE=' 
WHERE 
  key_id = 'c95a9662fb464bbc3ec41dd9a23c60398e5c6142ade96fc20ca9b704eb438cd9' 
  AND (
    token = '8DpF8/F6uy2tMCF7ILg4IriHdFoCeDKyGJLiA66q4tE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042