UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pdgJ6e3QpVkp32s4sEjuE+n/AK+40+JTVm7VPmWVMSo=' 
WHERE 
  key_id = '3392ec76b73d9259950c20352a63eb6a7c58a7d8230a34a961e21f0f56097cd6' 
  AND (
    token = 'pdgJ6e3QpVkp32s4sEjuE+n/AK+40+JTVm7VPmWVMSo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033