UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lnN+EGZgWiyi9VPPqtQts6aAxdQeTBhXCR66Gxc/GJY=' 
WHERE 
  key_id = 'b56e85f6e71661be74238a4d243728e96a0e0e28c0cdf59d0bef92902fbad5ad' 
  AND (
    token = 'lnN+EGZgWiyi9VPPqtQts6aAxdQeTBhXCR66Gxc/GJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016