UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8NrDcOShJlHb0tr4eFyA+Ts/Kx2j29LMH2uqpLhkS0k=' 
WHERE 
  key_id = '93f06309f730b96b1b783d657eb79d6f240fe5332f20e528eb3d1ada189581d9' 
  AND (
    token = '8NrDcOShJlHb0tr4eFyA+Ts/Kx2j29LMH2uqpLhkS0k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037