UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0xvyrhOkMz1eHAYY9nfjcJ6+k/JuLiClSCZcfX9jmIA=' 
WHERE 
  key_id = '8a95f57589fdbd1a484c13f66396f03c511c5c6cef1d1e0611f2e094b83b65de' 
  AND (
    token = '0xvyrhOkMz1eHAYY9nfjcJ6+k/JuLiClSCZcfX9jmIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033