UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6ZWwSK7c6b3BvSyirvkw2Wuit9UKKCuT+KKK2eu/u0k=' 
WHERE 
  key_id = '745fb11d0fdbd07ef699d89838288a92eb9a853d4c73fa524ccf38f9f28cb55b' 
  AND (
    token = '6ZWwSK7c6b3BvSyirvkw2Wuit9UKKCuT+KKK2eu/u0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035