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

Query time 0.00044