UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't1pK8Q0MbKwUr/yxGicijNvFmJyQLgc7djhihCPR1jA='
WHERE
key_id = '470b21c549b4006df3e007a3a6d13e1ed3641812e4f13ac64a519e3a7a542a6f'
AND (
token = 't1pK8Q0MbKwUr/yxGicijNvFmJyQLgc7djhihCPR1jA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)