UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uPxcsZUrZee7TMqHYlfN0TqivowYT+flnixLyLxw69U='
WHERE
key_id = '532a86a021f50bf7cd2daa0f309290d6b853731a6acd030e894ed5fabb02248a'
AND (
token = 'uPxcsZUrZee7TMqHYlfN0TqivowYT+flnixLyLxw69U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)