UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'umGYtLbs/YkLPz4X9goct+C7pn/1xaqHDHHNUUJIs/E='
WHERE
key_id = 'f9218ad333ef5ad3afd7de60f9d9bd0b99e800220ea98591f4b1129c3763c7fb'
AND (
token = 'umGYtLbs/YkLPz4X9goct+C7pn/1xaqHDHHNUUJIs/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)