UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mZhVEAtha6hQiFqFlGoc6PyJyouxCnA+FzyLJ0nNNhU='
WHERE
key_id = '33faa515442fe8f0dde667c7d3b3b59b1d22c4db4f9af94f699815bf15ed94ac'
AND (
token = 'mZhVEAtha6hQiFqFlGoc6PyJyouxCnA+FzyLJ0nNNhU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)