UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9I3IGRmGBYdKXPruI/Z5MBACLsNyGHFMWCOBhj+tYJM=' 
WHERE 
  key_id = 'c3d6ecc82faa23f90ecc42a8f642c44341287d13ea741cadaa46546a1352be9e' 
  AND (
    token = '9I3IGRmGBYdKXPruI/Z5MBACLsNyGHFMWCOBhj+tYJM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044