UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'meEfECcxFkcoM2zvJH8eB4/QgoEhZfSTb/DkIp4dPrs=' 
WHERE 
  key_id = '2af189e296eacc3440052f16bd897788c6226858a532a926545ad8b316f831f9' 
  AND (
    token = 'meEfECcxFkcoM2zvJH8eB4/QgoEhZfSTb/DkIp4dPrs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040