UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nn3/nWW//5aeTfv2mtky/fYEBSfK3hDhqfxnoiilA5k='
WHERE
key_id = '46145bd36a5c62adc0b44f151c369578c1f3b39a9934ebbdec0b0e1e8cd17d8c'
AND (
token = 'nn3/nWW//5aeTfv2mtky/fYEBSfK3hDhqfxnoiilA5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)