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