UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZgmGsTgecJm65e1pfwXHG9Me4TfRydNaZeRha6fjtiQ=' 
WHERE 
  key_id = '83a54f049c024e3bed1ab9d39fa94679b1224589ae4c991fc50fc53a4c33ff09' 
  AND (
    token = 'ZgmGsTgecJm65e1pfwXHG9Me4TfRydNaZeRha6fjtiQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053