UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ul9vb8YAFWVxSn7ccIGmahoPw1JxqjY1fQVN4Pkc2+c='
WHERE
key_id = 'b55e8ff9fcd9de7121c81c7e8d7317160f637ae6875d11889d56e8d96f72d4e9'
AND (
token = 'Ul9vb8YAFWVxSn7ccIGmahoPw1JxqjY1fQVN4Pkc2+c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)