UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9S1/Y/KESJIBVA7OuA+DZeOMR4flUr8BgYxuP+v8InA=' 
WHERE 
  key_id = '2d99a4d6d4bd743b9f1e7b8e08e7dad378d950513794408aa2ff08ae951bb512' 
  AND (
    token = '9S1/Y/KESJIBVA7OuA+DZeOMR4flUr8BgYxuP+v8InA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024