UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ei8JknFhK2w8eGxv4hOHEVu+mNoYesFZzvVvR9JZV+Y=' 
WHERE 
  key_id = 'fb30890a7e6e179de4e55d00a048982c1e6ccc7109acb904e6de421548e35bd0' 
  AND (
    token = 'Ei8JknFhK2w8eGxv4hOHEVu+mNoYesFZzvVvR9JZV+Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042