UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S+yr3NHhG73OjYDKhRmrwBo3dyX8QsUX7waEK7S/IJI=' 
WHERE 
  key_id = '48ccaaa2cc6fa10238fdd1f7b7de812c10b5e568608b382f7182423017fd8957' 
  AND (
    token = 'S+yr3NHhG73OjYDKhRmrwBo3dyX8QsUX7waEK7S/IJI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00068