UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TNLm+x+CVfo0zL/Yucm9bgAHc8wn+z90FAg3hTsu6oQ='
WHERE
key_id = '946e0362ff3bd11eeb58f78ec8767c45b63568645f0765af08c0127cddf6e009'
AND (
token = 'TNLm+x+CVfo0zL/Yucm9bgAHc8wn+z90FAg3hTsu6oQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)