UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XlAOgpfe8Jg19AFwHP2KCQa9BLRYQ4U5ugXfehuTaJE='
WHERE
key_id = '5b749c19aea8973237c29ce0ec79696ed1f9e2e66bf0bb9a852661272a5ea536'
AND (
token = 'XlAOgpfe8Jg19AFwHP2KCQa9BLRYQ4U5ugXfehuTaJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)