UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ww0vXk4d1DMz43JUXgIOC0AEysCJ3dowzTWQHwbWc78=' 
WHERE 
  key_id = 'be10d288a358e0942d016a593273d8cab2300ebcbc97929369735acfedebba67' 
  AND (
    token = 'Ww0vXk4d1DMz43JUXgIOC0AEysCJ3dowzTWQHwbWc78=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020