UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V3+EItj7pvO3mtOm/ZURAnXw+hB9So2sbHHpRUKiXgY='
WHERE
key_id = '12f10ca4239dab3ad97feef47f53d6df77cb205e667a1e9a52915f9c60d91158'
AND (
token = 'V3+EItj7pvO3mtOm/ZURAnXw+hB9So2sbHHpRUKiXgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)