UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wMaAV9a6g/1HLnFNZOx0cecOtXXjg+02/Nd9WHm5LJY=' 
WHERE 
  key_id = '90845571fa057bcf7098825f1583a798f7af39d58b540ef856eda8935f44d625' 
  AND (
    token = 'wMaAV9a6g/1HLnFNZOx0cecOtXXjg+02/Nd9WHm5LJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029