UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0TBaM+pFPU7F/dfb9ckA3uwj5XMVx0pJs4zf6Tcos68=' 
WHERE 
  key_id = '924198596b3597795a6af0bcfdcb4d20f7f7d0b56ccaf52c9376f2ec38888e24' 
  AND (
    token = '0TBaM+pFPU7F/dfb9ckA3uwj5XMVx0pJs4zf6Tcos68=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042