UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cWMCp+nbv5BMLK7Gf4ExCkYLAloH8Qp9X4SFeBZQVNc=' 
WHERE 
  key_id = 'd0952dd2290d52cdebd0e08ef84ced033c47e41d5f0a225a699c62aabfa55cff' 
  AND (
    token = 'cWMCp+nbv5BMLK7Gf4ExCkYLAloH8Qp9X4SFeBZQVNc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021