UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cfmqlYU77vNQNXwj5I8FiFcSt5QXhObT6zCDeDhkwBc='
WHERE
key_id = 'c84a52704a907eee3d13b80186dc4a8a1e5d14fccfb70fb8b5cee7b9f9fdd944'
AND (
token = 'cfmqlYU77vNQNXwj5I8FiFcSt5QXhObT6zCDeDhkwBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)