UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NMMM415Xg1Zh25p0iFxV/ZTrmcp0Y+JJ+24KbCKyiy4=' 
WHERE 
  key_id = '44984039bc304909816f638c7646bf264ec029ec141ab3b3b759976ddc8f0eb9' 
  AND (
    token = 'NMMM415Xg1Zh25p0iFxV/ZTrmcp0Y+JJ+24KbCKyiy4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035