UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VNQ77tCfYdZePcpYRzz+jQkOtMch6yN0VpocHYgBnbQ='
WHERE
key_id = '292746a630234fb7294b7929936a709b0d1bccfaa0e429970e81d2fe41ce5310'
AND (
token = 'VNQ77tCfYdZePcpYRzz+jQkOtMch6yN0VpocHYgBnbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)