UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hJsjYBFzMqksaw16YSZErLxYbWO2tZ532UIHiK46kwg='
WHERE
key_id = '7dabb16a104b057440cdd9ef9df21be0cc83393f85a3872121de8e0f86ab6444'
AND (
token = 'hJsjYBFzMqksaw16YSZErLxYbWO2tZ532UIHiK46kwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)