UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0XeEBChEvrFiUvlznxbW27wckl9WjV/5YQfQZ3YvG9w='
WHERE
key_id = '13f77a9ae87a030667a8a64897377b295f62f506caf082b91111324eff73beb7'
AND (
token = '0XeEBChEvrFiUvlznxbW27wckl9WjV/5YQfQZ3YvG9w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)