UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3g3hDadKYzAzT4Sdfr0JRhnmUUzKrqBzrYhEMLJYlFs='
WHERE
key_id = '2d9bbb1ca99a49352dbc42854098a107f36109618c9bedc444ad0dcaabe380c4'
AND (
token = '3g3hDadKYzAzT4Sdfr0JRhnmUUzKrqBzrYhEMLJYlFs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)