UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3nxghaMrld0jI+thfE9PTqmgo0svTmn8aC7cx01fHsI=' 
WHERE 
  key_id = '04134ea82c429477590dee6e70d9667dd90e6b0f9f4c9ff4c1ebc7b6bf944104' 
  AND (
    token = '3nxghaMrld0jI+thfE9PTqmgo0svTmn8aC7cx01fHsI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023