UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mmuyg/dm9NL5J17lTsAjr5JGcBLxu9aJ1XPyzH9ogcs='
WHERE
key_id = 'ca8a686cc7577ae9f4732f58f02a280350c5fc45d852590fdd6de82352afd31b'
AND (
token = 'mmuyg/dm9NL5J17lTsAjr5JGcBLxu9aJ1XPyzH9ogcs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)