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