UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QfHcC7hVfoPAyIbBIfefM9/qsbRBgYE+maHmZJpkqTA='
WHERE
key_id = 'c76afad82a1aba928a303bf6bc74c79ae715c5454d697cfe046bc1816546d77b'
AND (
token = 'QfHcC7hVfoPAyIbBIfefM9/qsbRBgYE+maHmZJpkqTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)