UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fxEKf5FYmWrW1QgEjhNK/2fEFP81c6kxtInucb9yzg4='
WHERE
key_id = '9ccc177ff1be2a8a1fcc51eefb0a3b96e1a7061efb6804f7d1b6da4e4cafb17c'
AND (
token = 'fxEKf5FYmWrW1QgEjhNK/2fEFP81c6kxtInucb9yzg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)