UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6w5fBDI1DoHoycvrnVSREDFUAwLQuUSTXAZYDVQuSaE=' 
WHERE 
  key_id = '90317acfbe6248810341f14ee9a63c6d820c00dcb7098005702ec3f353fa4938' 
  AND (
    token = '6w5fBDI1DoHoycvrnVSREDFUAwLQuUSTXAZYDVQuSaE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028