UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EmEB1t6ITidBreCvlDfz9PJ2hBwDO+AKcC8bb4fkNKM=' 
WHERE 
  key_id = 'ae5e9aa09529778941cabb0526871cb5321862a639d7939b5daa32157a9c0a4a' 
  AND (
    token = 'EmEB1t6ITidBreCvlDfz9PJ2hBwDO+AKcC8bb4fkNKM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024