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