UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Hx02y7eHqVDOP9cPx3QFRQhv/Iaz/7CUlaAu6jZGIyc=' 
WHERE 
  key_id = '240766da8a8a4364e6d3bdc7d27ec560520a16f87d3c6db907217a011b6cc6a8' 
  AND (
    token = 'Hx02y7eHqVDOP9cPx3QFRQhv/Iaz/7CUlaAu6jZGIyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045