UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3K+ay7y4NHcZ2R7u8u7/T4e7YeREtgowg4hJeDa1ul8='
WHERE
key_id = 'd5c4809311d2e396dc1e8d521d149f04f42af0968eab35516af64a7908710554'
AND (
token = '3K+ay7y4NHcZ2R7u8u7/T4e7YeREtgowg4hJeDa1ul8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)