UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DcIt6Gg8w3LkF1vPDc7MLlkP7DfrJ1/q9tawL+XeHak='
WHERE
key_id = '6a1359d6969bc92da8876fa5e2aa6abc1c8852754a127419fb9d8ed5b1ca103a'
AND (
token = 'DcIt6Gg8w3LkF1vPDc7MLlkP7DfrJ1/q9tawL+XeHak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)