UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZzbyPY1rggj5ayUysST+qUOwtqcg/7NCogpPHfUMkyI='
WHERE
key_id = '0cee1996be5a222a9d9f13a3ee17c4b931b7b3872c7ef7f13ea105ae5f75d6c7'
AND (
token = 'ZzbyPY1rggj5ayUysST+qUOwtqcg/7NCogpPHfUMkyI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)